home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Technology Seed / August 1998 ADC Seed CD.toast / Mac OS 8.5b2 / allegro-b2-pseudo-SDK / CIncludes / Folders.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-07-17  |  13.5 KB  |  355 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Folders.h
  3.  
  4.      Contains:    Folder Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    Allego Seed, Use with 3.1 Universal Interfaces
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __FOLDERS__
  19. #define __FOLDERS__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47.  
  48. enum {
  49.     kOnSystemDisk                = -32768L                        /* previously was 0x8000 but that is an unsigned value whereas vRefNum is signed*/
  50. };
  51.  
  52.  
  53. enum {
  54.     kCreateFolder                = true,
  55.     kDontCreateFolder            = false
  56. };
  57.  
  58.  
  59. enum {
  60.     kSystemFolderType            = FOUR_CHAR_CODE('macs'),        /* the system folder */
  61.     kDesktopFolderType            = FOUR_CHAR_CODE('desk'),        /* the desktop folder; objects in this folder show on the desk top. */
  62.     kTrashFolderType            = FOUR_CHAR_CODE('trsh'),        /* the trash folder; objects in this folder show up in the trash */
  63.     kWhereToEmptyTrashFolderType = FOUR_CHAR_CODE('empt'),        /* the "empty trash" folder; Finder starts empty from here down */
  64.     kPrintMonitorDocsFolderType    = FOUR_CHAR_CODE('prnt'),        /* Print Monitor documents */
  65.     kStartupFolderType            = FOUR_CHAR_CODE('strt'),        /* Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here */
  66.     kShutdownFolderType            = FOUR_CHAR_CODE('shdf'),        /* Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here */
  67.     kAppleMenuFolderType        = FOUR_CHAR_CODE('amnu'),        /* Finder objects to put into the Apple menu go here */
  68.     kControlPanelFolderType        = FOUR_CHAR_CODE('ctrl'),        /* Control Panels go here (may contain INITs) */
  69.     kExtensionFolderType        = FOUR_CHAR_CODE('extn'),        /* System extensions go here */
  70.     kFontsFolderType            = FOUR_CHAR_CODE('font'),        /* Fonts go here */
  71.     kPreferencesFolderType        = FOUR_CHAR_CODE('pref'),        /* preferences for applications go here */
  72.     kTemporaryFolderType        = FOUR_CHAR_CODE('temp')        /* temporary files go here (deleted periodically, but don't rely on it.) */
  73. };
  74.  
  75. /*
  76.     Note:     The FindFolder trap was not implemented until System 7.  If you want to call FindFolder
  77.             while running on System 6 machines, then define USE_FINDFOLDER_GLUE and link with
  78.             Interface.o which contains glue to implement FindFolder on pre-System 7 machines.
  79. */
  80. #ifdef USE_FINDFOLDER_GLUE
  81. EXTERN_API( OSErr )
  82. FindFolder                        (short                     vRefNum,
  83.                                  OSType                 folderType,
  84.                                  Boolean                 createFolder,
  85.                                  short *                foundVRefNum,
  86.                                  long *                    foundDirID);
  87.  
  88. #else
  89. EXTERN_API( OSErr )
  90. FindFolder                        (short                     vRefNum,
  91.                                  OSType                 folderType,
  92.                                  Boolean                 createFolder,
  93.                                  short *                foundVRefNum,
  94.                                  long *                    foundDirID)                            TWOWORDINLINE(0x7000, 0xA823);
  95.  
  96. #endif  /* defined(USE_FINDFOLDER_GLUE) */
  97.  
  98. EXTERN_API( OSErr )
  99. ReleaseFolder                    (short                     vRefNum,
  100.                                  OSType                 folderType)                            TWOWORDINLINE(0x700B, 0xA823);
  101.  
  102.  
  103. #if !TARGET_OS_MAC
  104. /* Since non-mac targets don't know about VRef's or DirID's, the Ex version returns
  105.    the found folder path.
  106.  */
  107. EXTERN_API_C( OSErr )
  108. FindFolderEx                    (short                     vRefNum,
  109.                                  OSType                 folderType,
  110.                                  Boolean                 createFolder,
  111.                                  short *                foundVRefNum,
  112.                                  long *                    foundDirID,
  113.                                  char *                    foundFolder);
  114.  
  115. #endif  /* !TARGET_OS_MAC */
  116.  
  117. /******************************************/
  118. /* Extensible Folder Manager declarations */
  119. /******************************************/
  120.  
  121. /****************************/
  122. /* Folder Manager constants */
  123. /****************************/
  124.  
  125.  
  126. enum {
  127.     kExtensionDisabledFolderType = FOUR_CHAR_CODE('extD'),
  128.     kControlPanelDisabledFolderType = FOUR_CHAR_CODE('ctrD'),
  129.     kSystemExtensionDisabledFolderType = FOUR_CHAR_CODE('macD'),
  130.     kStartupItemsDisabledFolderType = FOUR_CHAR_CODE('strD'),
  131.     kShutdownItemsDisabledFolderType = FOUR_CHAR_CODE('shdD'),
  132.     kApplicationsFolderType        = FOUR_CHAR_CODE('apps'),
  133.     kDocumentsFolderType        = FOUR_CHAR_CODE('docs')
  134. };
  135.  
  136.  
  137. enum {
  138.                                                                 /* new constants */
  139.     kVolumeRootFolderType        = FOUR_CHAR_CODE('root'),        /* root folder of a volume */
  140.     kChewableItemsFolderType    = FOUR_CHAR_CODE('flnt'),        /* items deleted at boot */
  141.     kApplicationSupportFolderType = FOUR_CHAR_CODE('asup'),        /* third-party items and folders */
  142.     kTextEncodingsFolderType    = FOUR_CHAR_CODE('ƒtex'),        /* encoding tables */
  143.     kStationeryFolderType        = FOUR_CHAR_CODE('odst'),        /* stationery */
  144.     kOpenDocFolderType            = FOUR_CHAR_CODE('odod'),        /* OpenDoc root */
  145.     kOpenDocShellPlugInsFolderType = FOUR_CHAR_CODE('odsp'),    /* OpenDoc Shell Plug-Ins in OpenDoc folder */
  146.     kEditorsFolderType            = FOUR_CHAR_CODE('oded'),        /* OpenDoc editors in MacOS Folder */
  147.     kOpenDocEditorsFolderType    = FOUR_CHAR_CODE('ƒodf'),        /* OpenDoc subfolder of Editors folder */
  148.     kOpenDocLibrariesFolderType    = FOUR_CHAR_CODE('odlb'),        /* OpenDoc libraries folder */
  149.     kGenEditorsFolderType        = FOUR_CHAR_CODE('ƒedi'),        /* CKH general editors folder at root level of Sys folder */
  150.     kHelpFolderType                = FOUR_CHAR_CODE('ƒhlp'),        /* CKH help folder currently at root of system folder */
  151.     kInternetPlugInFolderType    = FOUR_CHAR_CODE('ƒnet'),        /* CKH internet plug ins for browsers and stuff */
  152.     kModemScriptsFolderType        = FOUR_CHAR_CODE('ƒmod'),        /* CKH modem scripts, get 'em OUT of the Extensions folder */
  153.     kPrinterDescriptionFolderType = FOUR_CHAR_CODE('ppdf'),        /* CKH new folder at root of System folder for printer descs. */
  154.     kPrinterDriverFolderType    = FOUR_CHAR_CODE('ƒprd'),        /* CKH new folder at root of System folder for printer drivers */
  155.     kScriptingAdditionsFolderType = FOUR_CHAR_CODE('ƒscr'),        /* CKH at root of system folder */
  156.     kSharedLibrariesFolderType    = FOUR_CHAR_CODE('ƒlib'),        /* CKH for general shared libs. */
  157.     kVoicesFolderType            = FOUR_CHAR_CODE('fvoc'),        /* CKH macintalk can live here */
  158.     kControlStripModulesFolderType = FOUR_CHAR_CODE('sdev'),    /* CKH for control strip modules */
  159.     kAssistantsFolderType        = FOUR_CHAR_CODE('astƒ'),        /* SJF for Assistants (MacOS Setup Assistant, etc) */
  160.     kUtilitiesFolderType        = FOUR_CHAR_CODE('utiƒ'),        /* SJF for Utilities folder */
  161.     kAppleExtrasFolderType        = FOUR_CHAR_CODE('aexƒ'),        /* SJF for Apple Extras folder */
  162.     kContextualMenuItemsFolderType = FOUR_CHAR_CODE('cmnu'),    /* SJF for Contextual Menu items */
  163.     kMacOSReadMesFolderType        = FOUR_CHAR_CODE('morƒ'),        /* SJF for MacOS ReadMes folder */
  164.     kALMModulesFolderType        = FOUR_CHAR_CODE('walk'),        /* EAS for Location Manager Module files except type 'thng' (within kExtensionFolderType) */
  165.     kALMPreferencesFolderType    = FOUR_CHAR_CODE('trip'),        /* EAS for Location Manager Preferences (within kPreferencesFolderType; contains kALMLocationsFolderType) */
  166.     kALMLocationsFolderType        = FOUR_CHAR_CODE('fall'),        /* EAS for Location Manager Locations (within kALMPreferencesFolderType) */
  167.     kColorSyncProfilesFolderType = FOUR_CHAR_CODE('prof'),        /* for ColorSync™ Profiles */
  168.     kThemesFolderType            = FOUR_CHAR_CODE('thme'),        /* for Theme data files */
  169.     kFavoritesFolderType        = FOUR_CHAR_CODE('favs'),        /* Favorties folder for Navigation Services */
  170.     kInternetFolderType            = FOUR_CHAR_CODE('intƒ'),        /* Internet folder (root level of startup volume) */
  171.     kAppearanceFolderType        = FOUR_CHAR_CODE('appr'),        /* Appearance folder (root of system folder) */
  172.     kSoundSetsFolderType        = FOUR_CHAR_CODE('snds'),        /* Sound Sets folder (in Appearance folder) */
  173.     kDesktopPicturesFolderType    = FOUR_CHAR_CODE('dtpƒ'),        /* Desktop Pictures folder (in Appearance folder) */
  174.     kInternetSearchSitesFolderType = FOUR_CHAR_CODE('issf'),    /* Internet Search Sites folder */
  175.     kFindSupportFolderType        = FOUR_CHAR_CODE('fnds'),        /* Find support folder */
  176.     kFindByContentFolderType    = FOUR_CHAR_CODE('fbcf'),        /* Find by content folder */
  177.     kInstallerLogsFolderType    = FOUR_CHAR_CODE('ilgf'),        /* Installer Logs folder */
  178.     kScriptsFolderType            = FOUR_CHAR_CODE('scrƒ'),        /* Scripts folder */
  179.     kFolderActionsFolderType    = FOUR_CHAR_CODE('fasf'),        /* Folder Actions Scripts folder */
  180.     kLauncherItemsFolderType    = FOUR_CHAR_CODE('laun'),        /* Launcher Items folder */
  181.     kRecentApplicationsFolderType = FOUR_CHAR_CODE('rapp'),        /* Recent Applications folder */
  182.     kRecentDocumentsFolderType    = FOUR_CHAR_CODE('rdoc'),        /* Recent Documents folder */
  183.     kRecentServersFolderType    = FOUR_CHAR_CODE('rsvr'),        /* Recent Servers folder */
  184.     kSpeakableItemsFolderType    = FOUR_CHAR_CODE('spki')        /* Speakable Items folder */
  185. };
  186.  
  187.  
  188. /* FolderDescFlags values */
  189.  
  190. enum {
  191.     kCreateFolderAtBoot            = 0x00000002,
  192.     kFolderCreatedInvisible        = 0x00000004,
  193.     kFolderCreatedNameLocked    = 0x00000008
  194. };
  195.  
  196. typedef UInt32                             FolderDescFlags;
  197. /* FolderClass values */
  198.  
  199. enum {
  200.     kRelativeFolder                = FOUR_CHAR_CODE('relf'),
  201.     kSpecialFolder                = FOUR_CHAR_CODE('spcf')
  202. };
  203.  
  204. typedef OSType                             FolderClass;
  205. /* special folder locations */
  206.  
  207. enum {
  208.     kBlessedFolder                = FOUR_CHAR_CODE('blsf'),
  209.     kRootFolder                    = FOUR_CHAR_CODE('rotf')
  210. };
  211.  
  212. typedef OSType                             FolderType;
  213. typedef OSType                             FolderLocation;
  214.  
  215.  
  216. struct FolderDesc {
  217.     Size                             descSize;
  218.     FolderType                         foldType;
  219.     FolderDescFlags                 flags;
  220.     FolderClass                     foldClass;
  221.     FolderType                         foldLocation;
  222.     OSType                             badgeSignature;
  223.     OSType                             badgeType;
  224.     UInt32                             reserved;
  225.     StrFileName                     name;                        /* Str63 on MacOS*/
  226. };
  227. typedef struct FolderDesc                FolderDesc;
  228. typedef FolderDesc *                    FolderDescPtr;
  229.  
  230.  
  231. typedef UInt32                             RoutingFlags;
  232.  
  233. struct FolderRouting {
  234.     Size                             descSize;
  235.     OSType                             fileType;
  236.     FolderType                         routeFromFolder;
  237.     FolderType                         routeToFolder;
  238.     RoutingFlags                     flags;
  239. };
  240. typedef struct FolderRouting            FolderRouting;
  241. typedef FolderRouting *                    FolderRoutingPtr;
  242. /* routing constants */
  243. /***************************/
  244. /* Folder Manager routines */
  245. /***************************/
  246. /* Folder Manager administration routines */
  247. EXTERN_API( OSErr )
  248. AddFolderDescriptor                (FolderType             foldType,
  249.                                  FolderDescFlags         flags,
  250.                                  FolderClass             foldClass,
  251.                                  FolderLocation         foldLocation,
  252.                                  OSType                 badgeSignature,
  253.                                  OSType                 badgeType,
  254.                                  ConstStrFileNameParam     name,
  255.                                  Boolean                 replaceFlag)                        TWOWORDINLINE(0x7020, 0xA823);
  256.  
  257. EXTERN_API( OSErr )
  258. GetFolderDescriptor                (FolderType             foldType,
  259.                                  Size                     descSize,
  260.                                  FolderDesc *            foldDesc)                            TWOWORDINLINE(0x7023, 0xA823);
  261.  
  262. EXTERN_API( OSErr )
  263. GetFolderTypes                    (UInt32                 requestedTypeCount,
  264.                                  UInt32 *                totalTypeCount,
  265.                                  FolderType *            theTypes)                            TWOWORDINLINE(0x7024, 0xA823);
  266.  
  267. EXTERN_API( OSErr )
  268. RemoveFolderDescriptor            (FolderType             foldType)                            TWOWORDINLINE(0x7021, 0xA823);
  269.  
  270. /* legacy routines */
  271. EXTERN_API( OSErr )
  272. GetFolderName                    (short                     vRefNum,
  273.                                  OSType                 foldType,
  274.                                  short *                foundVRefNum,
  275.                                  StrFileName             name)                                TWOWORDINLINE(0x700E, 0xA823);
  276.  
  277. /* routing routines */
  278. EXTERN_API( OSErr )
  279. AddFolderRouting                (OSType                 fileType,
  280.                                  FolderType             routeFromFolder,
  281.                                  FolderType             routeToFolder,
  282.                                  RoutingFlags             flags,
  283.                                  Boolean                 replaceFlag)                        TWOWORDINLINE(0x7026, 0xA823);
  284.  
  285. EXTERN_API( OSErr )
  286. RemoveFolderRouting                (OSType                 fileType,
  287.                                  FolderType             routeFromFolder)                    TWOWORDINLINE(0x7027, 0xA823);
  288.  
  289. EXTERN_API( OSErr )
  290. FindFolderRouting                (OSType                 fileType,
  291.                                  FolderType             routeFromFolder,
  292.                                  FolderType *            routeToFolder,
  293.                                  RoutingFlags *            flags)                                TWOWORDINLINE(0x7022, 0xA823);
  294.  
  295. EXTERN_API( OSErr )
  296. GetFolderRoutings                (UInt32                 requestedRoutingCount,
  297.                                  UInt32 *                totalRoutingCount,
  298.                                  Size                     routingSize,
  299.                                  FolderRouting *        theRoutings)                        TWOWORDINLINE(0x701E, 0xA823);
  300.  
  301. EXTERN_API( OSErr )
  302. InvalidateFolderDescriptorCache    (short                     vRefNum,
  303.                                  long                     dirID)                                TWOWORDINLINE(0x7025, 0xA823);
  304.  
  305. EXTERN_API( OSErr )
  306. IdentifyFolder                    (short                     vRefNum,
  307.                                  long                     dirID,
  308.                                  FolderType *            foldType)                            TWOWORDINLINE(0x701F, 0xA823);
  309.  
  310.  
  311.  
  312. enum {
  313.                                                                 /* new constants */
  314.     kGlobalPreferencesFolderType = FOUR_CHAR_CODE('gprf'),        /* preferences for all users/workspaces */
  315.     kSystem7SystemFolderType    = FOUR_CHAR_CODE('ƒblu'),        /* System 7 system folder */
  316.     kDebuggerExtensionsFolderType = FOUR_CHAR_CODE('ƒdeb'),        /* debugger extensions */
  317.     kDesktopModulesFolderType    = FOUR_CHAR_CODE('ƒdsk'),        /* desktop animation modules */
  318.     kExtensionLibrariesFolderType = FOUR_CHAR_CODE('ƒexl'),        /* leechlets */
  319.     kCoopExtensionLibrariesFolderType = FOUR_CHAR_CODE('ƒcex'),    /* blue leechlets */
  320.     kHardwareSupportFolderType    = FOUR_CHAR_CODE('ƒhdw'),        /* hardware support */
  321.     kLocalesFolderType            = FOUR_CHAR_CODE('ƒloc'),        /* locales */
  322.     kServerLibrariesFolderType    = FOUR_CHAR_CODE('ƒser'),        /* servers */
  323.     kSystemLibrariesFolderType    = FOUR_CHAR_CODE('ƒsys'),        /* system libraries */
  324.     kSoundsFolderType            = FOUR_CHAR_CODE('ƒsnd'),        /* sounds */
  325.     kVMFilesFolderType            = FOUR_CHAR_CODE('ƒvmf'),        /* temporary for DR 1 only */
  326.                                                                 /* known FolderType values */
  327.     kCurrentWorkspaceFolder        = FOUR_CHAR_CODE('cwsf'),
  328.     kWorkspacesFolder            = FOUR_CHAR_CODE('wksf'),
  329.     kSystem7BlessedFolder        = FOUR_CHAR_CODE('bls7')
  330. };
  331.  
  332.  
  333.  
  334.  
  335. #if PRAGMA_STRUCT_ALIGN
  336.     #pragma options align=reset
  337. #elif PRAGMA_STRUCT_PACKPUSH
  338.     #pragma pack(pop)
  339. #elif PRAGMA_STRUCT_PACK
  340.     #pragma pack()
  341. #endif
  342.  
  343. #ifdef PRAGMA_IMPORT_OFF
  344. #pragma import off
  345. #elif PRAGMA_IMPORT
  346. #pragma import reset
  347. #endif
  348.  
  349. #ifdef __cplusplus
  350. }
  351. #endif
  352.  
  353. #endif /* __FOLDERS__ */
  354.  
  355.